package telebase;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

public class Vars {

    private static String Version = "TeleBase 0.9.7-1";

    public static String getVersion() {
        return Vars.Version;
    }
    // Properties
    /*
     * AccessMode - access mode only for gui! Database security must be configured by admin!
     * Username - database user name;
     * Userpass - database user password;
     * DB_URL - url for connecting to database.
     * LangXML - language file name.
     *
     */
    public static Properties prop = new Properties();
    public static String PropFileName = "Options.xml";

    public static void SaveProperties() {
        try {
            prop.storeToXML(new FileOutputStream(PropFileName, false), null);
        } catch (IOException ex) {
            System.out.println("Vars.SaveProperties(): " + ex.toString());
        }
    }

    public static void LoadProperties() {
        try {
            Vars.prop.loadFromXML(new FileInputStream(PropFileName));
        } catch (IOException ex) {
            System.out.println("Vars.LoadProperties(): " + ex.toString());
        }
    }
}
